/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Mds_LogisticSiteAlias",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using DGZImp.MdsProject.DomainModels;
using DGZImp.MdsProject.IServices;
using DGZImp.Core.Utilities.Response;

namespace DGZImp.MdsProject.Controllers
{
    public partial class Mds_LogisticSiteAliasController
    {
        private readonly IMds_LogisticSiteAliasService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public Mds_LogisticSiteAliasController(
            IMds_LogisticSiteAliasService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        [HttpGet("GetSiteOptionsByRealDeviceId")]
        public async Task<ApiResponse<List<object>>> GetSiteOptionsByRealDeviceId(long? MachineId)
        {
            var r = await _service.GetSiteOptionsByRealDeviceId(MachineId);
            return ApiRes.Success(r);
        }
    }
}
